<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JQ事件之事件委托</title>
</head>
<body>
    <div class="box">
        <button class="btn">1</button>
        <button class="btn">2</button>
        <button>3</button>
        <button>4</button>
        <button>5</button>
        <button class="btn">6</button>
    </div>

    <script src="./js/jquery.3.5.1.js"></script>
    <script>
        $(function(){
            $('.box').on('click','.btn',function(){
                console.log($(this).text());
            })
        })
    </script>
</body>
</html>